int[] array = { 1, 3, 5 }; var lastItem = array[^1]; // 5
string[] items = GetAllItems(); string lastItem = items[items.Length - 1]; int arrayLength = array.Length;